import request, { OperateData } from '@/utils/request'
import { ReviewInfo, TargetValue } from './data'
import { PromiseData } from '@/@types/request'
import { IPressure } from '@/@types/common'

// 查询指标
export const getTargetValue = (data: {
  dataId: number
  variableValueDtos: { id?: number; variableId: string; variableValue: string }[]
}): Promise<PromiseData<TargetValue>> => request.post('/dataReport/getTargetValue', data)

// 查询变量数据
export const getDataTaskDetail = (data: { dataId: number }): Promise<PromiseData<ReviewInfo>> =>
  request.post('/dataReport/getDataTaskDetail', data)

// 获取事件内容
export const getInjuryInformation = (data: { dataId: number; type?: string }): Promise<PromiseData<IPressure[]>> =>
  request.post('/dataReport/getInjuryInformation', data)

// 申请修改
export const escalationApplyUpdate = (data: any): Promise<PromiseData<OperateData>> =>
  request.post('/dataEscalationExamineApplyUpdate/dataEscalationApplyUpdate', data)

// 新增事件
export const addEventHandle = (data: any): Promise<PromiseData<any>> =>
  request.post('/reportDataInjury/insertReportData', data)

// 修改事件
export const editEventHandle = (data: any): Promise<PromiseData<any>> =>
  request.post('/reportDataInjury/updateReportData', data)

// 删除事件
export const deleteEventHandle = (data: any): Promise<PromiseData<any>> =>
  request.post('/reportDataInjury/deleteReportData', data)

// 获取级联层级
export const getOrganization = (data: { hospitalCode: any }): Promise<PromiseData<any>> =>
  request.post('/wardManage/getOrganization', data)
